﻿using System;

namespace Vessel_calculation.Classes
{
	/// <summary>
	/// Description of Ship_Parameters.
	/// </summary>
	public class Ship_Parameters
	{
		public double Lpp, B, T;
		public double L_B, B_T;
		
		public Ship_Parameters()
		{
		}
		
		public Ship_Parameters(double Lpp, double L_B, double B_T)
		{
			this.Lpp = Lpp;
			this.L_B = L_B;
			this.B_T = B_T;
			calculate_B();
			calculate_T();
		}
		
		public Ship_Parameters(Ship_Parameters a)
		{
			this.Lpp = a.Lpp;
			this.B = a.B;
			this.T = a.T;
			this.L_B = a.L_B;
			this.B_T = a.B_T;
		}
		
		private void calculate_B()
		{
			this.B = Round(this.Lpp/this.L_B);
		}
		
		private void calculate_T()
		{
			this.T = Round(this.B/this.B_T);
		}
		
		private double Round(double M)
		{
			return Math.Round(100*M)/100;
		}
	}
}
